package practice01;

public class StringApiDemo {
    public static void main(String[] args) {
        //"java woaijava,i like jajavava,i enjoy java"去除java字符串
        //” woai,i like ,i enjoy"输出结果
        String str = "java woaijava,i like jajavava,i enjoy java";
        StringBuilder string = new StringBuilder(str);
        while (true){
            int a = string.indexOf("java");
            if (a==-1){
                break;
            }
            string.delete(a,a+4);
        }
        System.out.println(string);
    }
}
